<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddSomeColumnSecondToProducts extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->unsignedInteger('base_view')->comment('虚拟查看量');
            $table->unsignedInteger('view_count')->comment('用户查看量');
            $table->unsignedInteger('share_count')->comment('用户分享量');
            $table->unsignedInteger('recommend_count')->comment('推荐量');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn('base_view');
            $table->dropColumn('view_count');
            $table->dropColumn('share_count');
            $table->dropColumn('recommend_count');
        });
    }
}
